﻿using System;
using System.Collections.Generic;
using Windows.UI.Xaml.Data;

namespace Sumc.Client.ModernUI.Converters
{
    public class EnumerationToTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var enumeration = value as IEnumerable<string>;
            if (enumeration != null)
            {
                return string.Join(", ", enumeration);
            }

            return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            return value;
        }
    }
}
